<!DOCTYPE html>
<html lang="en" class="no-js">

<head>

    <meta charset="utf-8">
    <title>vaeThink</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- CSS -->
    <link rel="stylesheet" href="/static/css/supersized.css">
    <link rel="stylesheet" href="/static/css/style.css">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

</head>
<style>
    #regist:hover{
        color: red!important;
    }
    .captcha>img{
        margin-top: 14px;
    }
</style>

<body oncontextmenu="return false">

<div class="page-container">
    <h1>vaethink</h1>
    <form action="" id="vaeyo-login">
        <div>
            <input type="text" name="username" class="username" placeholder="请输入用户名" autocomplete="off" value="" lay-verify="required"/>
        </div>
        <div>
            <input type="password" name="password" class="password" placeholder="请输入密码" oncontextmenu="return false" onpaste="return false" lay-verify="required"/>
        </div>
        <div>
            {{create_captcha}}
            <input type="search" name="captcha" placeholder="请输入验证码" autocomplete="off" style="width:140px;float: left;" lay-verify="required"/>
        </div>
        <button id="submit" type="button">登 录</button>
    </form>
    <div class="connect">
        <p>一个轻松提高推广转化率的网站.</p>
        <p style="margin-top:20px;">如果只是遇见，不能停留，不如不遇见。</p>
        <p style="margin-top:20px; color: #aa1111;cursor: pointer;" id="regist">没有账号？点击注册吧</p>
    </div>
</div>
<div class="alert" style="display:none">
    <h2>消息</h2>
    <div class="alert_con">
        <p id="ts"></p>
        <p style="line-height:30px"><a class="btn">确定</a></p>
    </div>
</div>

<!-- Javascript -->
<script src="http://apps.bdimg.com/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>
<script src="/static/js/supersized.3.2.7.min.js"></script>
<script src="/static/js/supersized-init.js"></script>
<script>
    $(".btn").click(function(){
        is_hide();
    })
    var u = $("input[name=username]");
    var p = $("input[name=password]");
    $("#submit").live('click',function(){
        if(u.val() == '' || p.val() =='')
        {
            $("#ts").html("用户名或密码不能为空~");
            is_show();
            return false;
        }
        else{
            $.post("/login",$('#vaeyo-login').serialize(),function (res) {
                        $("#ts").html(res.errmsg);
                        is_show();
                        if(res.errno === 1) {
                            setTimeout(function() {
                                location.href = '/';
                            }, 1500);
                        } else {
                            $('.captcha-img').click();
                            $("#ts").html(res.errmsg);
                            is_show();
                        }
            })
        }
    });

    $("#regist").click(function () {
        window.location.href = "{:url('admin/publicer/regist')}";
    })
    window.onload = function()
    {
        $(".connect p").eq(0).animate({"left":"0%"}, 600);
        $(".connect p").eq(1).animate({"left":"0%"}, 400);
        $(".connect p").eq(2).animate({"left":"0%"}, 600);
    }
    function is_hide(){ $(".alert").animate({"top":"-40%"}, 300) }
    function is_show(){ $(".alert").show().animate({"top":"12%"}, 300) }
</script>
</body>

</html>

